#include<iostream>
#include<cstring>
using namespace std;
//这里的Date对象，不要复制D题，自己写
//因为不需要getDayofYear()
class Date
{
    private:
        int dy,dm,dd;
    public:
        Date(int _y,int _m,int _d):dy(_y),dm(_m),dd(_d){ }
        int getYear(){return dy;}
        int getMonth(){ return dm;}
        int getDay(){return dd;}
};
class Phone
{
    private:
        char type,state;
        string number;
        Date* da=NULL;
        //这里的封闭类实现，题目要求用对象指针
        //而且，这个对象指针，在Stop之后，才开始赋值
        //因为在构造函数时，指针是没办法直接赋值的，因为还没有把空间new出来
    public:
        Phone(char _ty,string _na,char _sta):type(_ty),number(_na),state(_sta)
        {
            cout<<"Construct a new phone "<<number<<endl;
        }
        Phone(const Phone& s)
        {
            cout<<"Construct a copy of phone "<<s.number<<endl;
            type='D';
            state=s.state;
            number=s.number+"X";
        }
        void Stopp(Date& a)
        {
            state='3';
            da=new Date(a.getYear(),a.getMonth(),a.getDay());
            cout<<"Stop the phone "<<number<<endl;
        }
        void Print()
        {
            if(type=='A')
                cout<<"类型=机构||号码="<<number;
            else if(type=='B')
                cout<<"类型=企业||号码="<<number;
            else if(type=='C')
                cout<<"类型=个人||号码="<<number;
            else
                cout<<"类型=备份||号码="<<number;
            
            if(state=='1')
                cout<<"||State=在用"<<endl;
            else if(state=='2')
                cout<<"||State=未用"<<endl;
            else
                cout<<"||State=停用 ||停机日期="<<da->getYear()<<"."<<da->getMonth()<<"."<<da->getDay()<<endl;
        }
        ~Phone()
        {
            if(da)
                delete[] da;
        }
};
int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        char type,state;
        string numb;
        int y,m,d;
        cin>>type>>numb>>state>>y>>m>>d;
        Phone tmp(type,numb,state);
        Date a(y,m,d);
        tmp.Print();
        Phone ans(tmp);
        ans.Print();
        tmp.Stopp(a);
        tmp.Print();
        cout<<"----"<<endl;
    }
}